{template header}

<div class="container">


    <div class="panel panel-default">
        <div class="panel-body">
        <div class="onecate">
            <ul>
                <li><a href="{tsUrl('study')}">首页</a></li>
                {loop $arrOneCate $key $item}
                <li>
                    <a {if $item['cateid']==$strStudy['cateid']}class="select"{/if} href="{tsUrl('study','cate',array('id'=>$item['cateid']))}"> {$item['catename']}</a>
                </li>
                {/loop}
                <li class="create"><a href="{tsUrl('study','create')}">创建课程</a></li>
            </ul>
        </div>
        </div>
    </div>


    <div class="twocate">
        <h1><a href="{tsUrl('study','cate',array('id'=>$oneCate['cateid']))}">{$oneCate['catename']}</a></h1>
        <ul class="channel-nav">
            {loop $arrTwoCate $key $item}
            <li><a {if $item['cateid']==$strStudy['cateid2']}class="on"{/if} href="{tsUrl('study','cate',array('id'=>$item['cateid']))}" >{$item[catename]}</a></li>
            {/loop}
        </ul>
    </div>


<div class="row">


<div class="col-md-8">




    <div class="panel panel-default">
        <div class="panel-body">
     <div class="row">
        <div class="col-md-4">

            <img src="{$strStudy['photo']}" alt="{$strStudy['studyname']}" style="width: 100%;" />


            <div class="clear"></div>

            <div style="margin-bottom:0px" class="pills">
                <a class="on" href="{tsUrl('study','show',array('id'=>$strStudy[studyid]))}">课时</a>
                {if $strStudy['userid']==$TS_USER['userid'] || $TS_USER['isadmin']==1}
                <a href="{tsUrl('study','edit',array('ts'=>'base','studyid'=>$strStudy['studyid']))}">管理</a>
                <a href="{tsUrl('study','edit',array('ts'=>'lessonadd','studyid'=>$strStudy[studyid]))}">添加新课时</a>
                {/if}
            </div>


        </div>
        <div class="col-md-8">


                <h1 style="margin: 0;">
                    <a href="{tsUrl('study','show',array('id'=>$strStudy['studyid']))}">{$strStudy[studyname]}</a>
                </h1>

                <div class="c9">

                    <div class="price">价格：<i>￥{$strStudy['price']}</i></div>

                    课时：<span>{$strStudy['count_lesson']} 课</span>
                    <br />
                    学员：<span>{$strStudy['count_learn']} 人</span>
                    <br />
                    浏览：<span>{$strStudy['count_view']} 次</span>
                </div>



            <div class="tar">

                {if $strStudy['learn']}

                {if $strStudy['learn']['status']==2}
                已学完
                {/if}
                {if $strStudy['learn']['status']==1}
                已学{$strStudy['learn']['count_lesson']}课时
                {/if}

                {else}
                <a class="btn btn-large btn-success" href="javascript:void('0');" onclick="studyLearn('{$strStudy['studyid']}');">购买学习</a>
                {/if}
            </div>

        </div>
    </div>
    </div>
    </div>




    <div class="panel panel-default">
        <div class="panel-heading">课时 <span class="lessons-total">(共{$strStudy['count_lesson']}课)</div>
        <div class="panel-body lessons">

            <ul>
                {loop $arrLesson $key $item}
                <li >
                    <span class="lesson-index">L{$item['orderid']}</span>
<span class="lesson-title">
<a title="{$item['title']}" href="{tsUrl('study','lesson',array('id'=>$item['lessonid']))}">{$item[title]}</a>
</span>
<span class="lesson-learned-status">
{if $arrIsLearn[$item['lessonid']]}
<font color="#999999">已学</font>
{else}
未学
{/if}
</span>
                </li>
                {/loop}
            </ul>
            <div class="page">{$pageUrl}</div>
        </div>
    </div>


    <div class="panel panel-default">
        <div class="panel-heading">课程介绍</div>
        <div class="panel-body">
<p>{$strStudy['studydesc']}</p>
</div>
</div>





    <div class="panel panel-default">
        <div class="panel-heading">相关课程</div>
        <div class="panel-body">



            <div  class="row kecheng">
                {loop $arrRelatedStudy $key $item}
                <div class="col-md-4">


                    <div class="thumbnail">

                        <div class="photo"><a href="{tsUrl('study','show',array('id'=>$item['studyid']))}">
                            {if $item['photo']}
                            <img src="{php echo tsXimg($item['photo'],'study','255','140',$item['path'],'1')}" />
                            {else}
                            <img alt="{$item['studyname']}" src="{SITE_URL}app/study/skins/default/kecheng.gif">
                            {/if}
                        </a>
                        </div>
                        <p class="title"><a title="{item['studyname']}" href="{tsUrl('study','show',array('id'=>$item['studyid']))}">{$item['studyname']}</a></p>
                        <p>
                            <span>学员：{$item['count_learn']}</span>
                            <span>课时：{$item['count_lesson']}</span>
                            <span><a title="{$item['user']['username']}" href="{tsUrl('user','topic',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a></span>
                        </p>


                    </div>


                </div>
                {/loop}
            </div>



</div>
</div>




</div>

    <div class="col-md-4">


        <div class="panel panel-default">
            <div class="panel-heading">课程创建人</div>
            <div class="panel-body">


                <div class="media">
                    <div class="media-left">
                        <a href="{tsUrl('user','topic',array('id'=>$strStudy['user']['userid']))}">
                            <img class="media-object" src="{$strStudy['user']['face']}" alt="{$strStudy['user']['username']}" width="60">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading">{$strStudy['user']['username']}</h4>

                    </div>
                </div>



</div>
</div>




        <div class="panel panel-default">
            <div class="panel-heading">最近加入的学员 <span class="right"><a href="{tsUrl('study','user',array('studyid'=>$strStudy['studyid']))}">全部</a></span></div>
            <div class="panel-body">



                <div class="row">
                    {loop $arrLearnUser $key $item}
                    <div class="col-md-3 tac">
                        <a href="{tsUrl('user','topic',array('id'=>$item[userid]))}" ><img class="img-circle" src="{$item[face]}" alt="{$item[username]}" width="48" height="48" /></a>
                        <div class="username pd100"><a href="{tsUrl('user','topic',array('id'=>$item[userid]))}"  title="{$item[username]}">{$item[username]}</a></div>
                    </div>
                    {/loop}
                </div>

                

</div>
</div>


</div>


</div>
</div>



{template footer}